package com.hauwei.huaweishop.service.impl;

import com.hauwei.huaweishop.dao.ShopTypesDao;
import com.hauwei.huaweishop.entity.ShopTypes;
import com.hauwei.huaweishop.service.ShopTypesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Service接口实现类
 */
@Service
@Transactional
public class ShopTypesServiceImpl implements ShopTypesService {
    @Autowired
    private ShopTypesDao shopTypesDao;

    @Override
    @Transactional(propagation = Propagation.SUPPORTS)
    public void addShopTypes(ShopTypes shopTypes) {
        shopTypesDao.addShopTypes(shopTypes);
    }

    @Override
    public void deleteShopTypesBySid(Integer sid) {
        shopTypesDao.deleteShopTypesBySid(sid);
    }

    @Override
    public void deleteShopTypesBySname(String sname) {
        shopTypesDao.deleteShopTypesBySname(sname);
    }

    @Override
    @Transactional(propagation = Propagation.SUPPORTS)
    public void updateShopTypes(ShopTypes shopTypes) {
        shopTypesDao.updateShopTypes(shopTypes);
    }

    @Override
    @Transactional(propagation = Propagation.SUPPORTS)
    public List<ShopTypes> queryShopTypesList() {
        return shopTypesDao.queryShopTypesList();
    }

    @Override
    public ShopTypes queryBySname(String sname) {
        return shopTypesDao.queryBySname(sname);
    }

    @Override
    public ShopTypes queryBySid(Integer sid) {
        return shopTypesDao.queryBySid(sid);
    }
}
